package main

import (
	"fmt"
	"os"

	"../jsonmarshal"
)

func main() {
	type ColorGroup struct {
		ID     int
		Name   string
		Colors []string
	}
	group := ColorGroup{
		ID:     1,
		Name:   "Reds",
		Colors: []string{"Crimson", "Red", "Ruby", "Maroon"},
	}

	b1, err1 := jsonmarshal.JsonMarshal(group)
	if err1 != nil {
		fmt.Println("error:", err1)
	}
	os.Stdout.Write(b1)
	//Output: {"ID":1,"Name":"Reds","Colors":["Crimson","Red","Ruby","Maroon"]}
}
